/*
 * @Author: Bennty
 * @Date: 2024-09-24 14:45:15
 * @LastEditors: Please set LastEditors
 * @LastEditTime: 2024-11-01 17:20:25
 * @Description: 请填写简介
 */
import request from '@/utils/request';

/** 新增材料大类信息 */
export const addTotalCategoryApi = (data: any) => {
    return request({
        url: '/system/materialMajor',
        method: 'post',
        data: data
    });
};

/** 修改材料大类信息 */
export const editTotalCategoryApi = (data: any) => {
    return request({
        url: '/system/materialMajor',
        method: 'put',
        data: data
    })
};

/** 查询材料大类信息列表 */
export const getTotalCategoryListApi = (data: any) => {
    return request({
        url: '/system/materialMajor/list',
        method: 'post',
        data: data
    });
};

/** 获取材料大类信息详细信息 */
export const getTotalCategoryDetailApi = (id: string| number| undefined) => {
    return request({
        url: `/system/materialMajor/${id}`,
        method: 'get'
    });
};

/** 删除材料大类信息 */
export const deleteTotalCategoryApi = (ids:string| number| undefined ) => {
    return request({
        url: `/system/materialMajor/${ids}`,
        method: 'delete'
    });
};

/** 查询所有材料大类列表,根据材料类别 */
export const getTotalCategoryByMaterialTypeApi = (data: any) => {
    return request({
        url: `/system/materialMajor/getAllList`,
        method: 'get',
        params: data
    });
};

/** 根据大类获取小类列表 */
export const getSingleByTotalApi = (majorType: string, onlyStainless=" ") => {
    return request({
        url: '/system/materialSubclass/getByMajorType',
        method: 'get',
        params: {majorType: majorType, onlyStainless:onlyStainless}
    });
};

/** 查询材料小类信息列表 */
export const getSingleListApi = (data: any) => {
    return request({
        url: '/system/materialSubclass/list',
        method: 'post',
        data: data
    });
};

/** 新增材料小类 */
export const addSingleApi = (data:any) => {
    return request({
        url: '/system/materialSubclass',
        method: 'post',
        data: data
    });
};

/** 修改材料小类信息 */
export const editSingleApi = (data:any) => {
    return request({
        url: '/system/materialSubclass',
        method: 'put',
        data: data
    });
};

/** 获取材料小类信息详细信息 */
export const getSingleCatagoryDetailApi = (id: string | number | undefined) => {
    return request({
        url: `/system/materialSubclass/${id}`,
        method: 'get'
    });
};

/** 删除材料小类信息 */
export const deleteSingleCatagoryApi = (ids: string | number | undefined) => {
    return request({
        url: `/system/materialSubclass/${ids}`,
        method: 'delete'
    });
};
